This application claims the priority benefit of Taiwan application serial no. 89101460, filed Jan. 28, 2000.
1. Field of the Invention
The invention relates to a phase comparator and a method for phase difference comparison using the same, and more particularly to a comparator and a method for calculating the phase difference between an output wave form and an input wave form using an orthogonal characteristic.
2. Description of the Related Art
Typically, disk drives, such as soft disk drives, hard disk drives and compact disk (CD) drives, each use different devices having different parameters in its own compensator system, resulting in a drift on an output result. In order to make each manufactured disk drive have a consistent system bandwidth, the operation of an open loop gain adjustment must be performed in the compensator system thereof.
Furthermore, to resolve the above problem, a test wave form must be inputted to the circuit system of each disk drive to generate an output wave form. Next, a phase comparator receives the test wave form and the output wave form to calculate the phase difference therebetween. Thereafter, the compensator performs a gain adjustment according to the phase difference thereby to keep the system bandwidth consistent.
Referring to FIG. 1, a device for a phase difference calculation according to the prior art is shown. First, a test wave form, generally a sine wave form, is inputted to a circuit system 10 of a CD driver (not shown) to generate a corresponding signal. According to the corresponding signal, a band pass filter 20 outputs an output wave form. The central frequency of the band pass filter 20 is the same as the frequency of the test wave form. Then, a phase comparator 30 receives the test wave form and the output wave form to generate a resultant signal back to the circuit system 10 for performing an open loop gain adjustment. As a result, each disk drive can be well controlled to have a consistent phase difference.
Referring now to FIG. 2, the phase difference between the test wave form and the output wave form is shown. In the prior art, a sampling signal is used to sample two zero cross points of the test wave form and the output wave form thereby to obtain a time difference between the two zero cross points as shown in FIG. 2.
However, it is inevitable that the output wave form after being inputted to the circuit system 10 will bring a plenty of noise signals. Assume that the noise signals are generated around the two zero cross points, and therefore, the phase comparator 30 can not accurately calculate the phase difference of the two signals, or the phase difference will be erroneously calculated.
In view of the above, the invention relates to a comparator and a method for calculating the phase difference between an output wave form and a test wave form using an orthogonal characteristic.
A phase comparator for calculating the phase difference between a test wave form and an output wave form in a disk drive according to the invention includes a phase converter, a first multiplier, a first integrator, a second multiplier, a second integrator and a phase angle calculator. The phase converter for delaying the test wave form for a specific time based on the frequency thereof. The first multiplier electrically coupled to the phase converter for performing a first operation by multiplying the delayed test wave form with the output wave form. The first integrator electrically coupled to the first multiplier for integrating the result of the first operation for a period to generate a first weighted value. The second multiplier for performing a second operation by multiplying the test wave form with the output wave form. The second integrator electrically coupled to the second multiplier for integrating the result of the second operation for the same period to generate a second weighted value. The phase angle calculator electrically coupled to the first integrator and the second integrator for receiving the first weighted value and the second weighted value and then outputting a value representing the phase difference between the test wave form and the output wave form.
A method for calculating the phase difference between a test wave form and an output wave form according to the invention includes the following steps. The test wave form is delayed for a specific time. A first operation is performed by multiplying the output wave form with the delayed test wave form. The result of the first operation is integrated for a period to generate a first weighted value. A second operation is performed by multiplying the output wave form with the test wave form. The result of the second operation is integrated for the same period to generate a second weighted value. A value of tan-1 (the first weighted value/the second weighted value) is calculated.